/*
 * @Description: 路由配置
 * @Author: wuju
 * @Date: 2022-1-9 00:42:56
 * @LastEditors: wuju
 * @LastEditTime: 2022年1月9日00:42:53
 */
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [

  {
    path: '/',
    name: 'Index',
    component: () => import('../views/Index.vue')
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import('../views/Test.vue')
  },
  {
    path: '/app/create',
    name: '创建仓库',
    component: () => import('../views/app/create.vue')
  },
  {
    path: '/app/text/create',
    name: '创建文档',
    component: () => import('../views/app/text/create.vue')
  }
]

const router = new Router({
  // base: '/dist',
  // mode: 'history',
  routes
})

/* // 禁止全局路由错误处理打印
const originalPush = Router.prototype.push;
Router.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject)
    return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
} */

export default router